package com.example.tang.zhayan.utils;

import android.content.Context;
import android.view.Display;
import android.view.WindowManager;

/**
 * Created by tang on 2015/12/16.
 */
public class WindowsUtils {
    private Context context;
    private WindowManager manager;
    ;

    public WindowsUtils(Context context) {
        this.context = context;
        manager = (WindowManager) context.getSystemService(context.WINDOW_SERVICE);
    }



    /**
     * 获取屏幕的宽度
     */
    public int getScreenWidth() {
        Display display = manager.getDefaultDisplay();
        return display.getWidth();
    }

    /**
     * 获取屏幕的高度
     */
    public int getScreenHeight() {
        Display display = manager.getDefaultDisplay();
        return display.getHeight();
    }

}
